package presentation;


import java.awt.BorderLayout;
import java.awt.Dimension;
import java.awt.Graphics2D;
import java.io.IOException;
import java.rmi.NotBoundException;
import java.rmi.RemoteException;
import java.util.Scanner;

import javax.swing.JFrame;
import javax.swing.JTabbedPane;

import connector.rmiServer.ServerService;
import control.CActioner;
import control.TaxaFactory;
import control.connector.ConRMI;

/**
 * @author   DanniD
 */
public class PMainFrame extends JFrame {
	
	public static void main(String[] args) throws NotBoundException, IOException {
		//ServerService server = ConRMI.getServer();
		JFrame frame = new JFrame();
		frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		frame.setTitle("TTC");
		JTabbedPane tp = new JTabbedPane();
		PMapPanel mapP = new PMapPanel();
		tp.addTab("Map", mapP);
		tp.addTab("Analysis", new AnalasysPanel());
		
		TaxaFactory.addObserver(mapP);
//		CActioner.makeOrders();
		
		frame.getContentPane().add(tp);
		frame.setPreferredSize(new Dimension(800, 600));
		frame.pack();
		frame.setVisible(true);
		System.out.println("Dette er TT central klient");
		
		//New part, asking for a default map
		mapP.newImage();
		mapP.chooseImage(0);
		
	}
}